package com.example.service.impl;

import com.example.dao.PersonalDao;
import com.example.pojo.Personal;
import com.example.service.PersonalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by IntelliJ IDEA2021.3
 *
 * @Author: Tenghw
 * @Date: 2022/03/21  16:47
 * @Description:
 */
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
@SuppressWarnings("all")
public class PersonalServiceImpl implements PersonalService {
    @Autowired
    PersonalDao personalDao;

    @Override
    public List<Personal> getServiceAll() {
        log.info("=======进入service层getServiceAll() ============");
        return personalDao.getAll();
    }

    @Override
    public Personal getServiceOne(int id) {
        return personalDao.getOne(id);
    }
}
